feat(ag-ui): FakeAgent for offline cockpit demo#140
Merged
Conversation
5 tasks: implement FakeAgent + spec, provideFakeAgUiAgent + spec, public-api exports, cockpit demo rewiring, verify + PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In-process AbstractAgent subclass that emits a canned streaming
response. Drop-in replacement for provideAgUiAgent({ url }) when
no real backend is available. Tests cover event ordering, token
streaming, and unsubscribe cancellation.
Deviation from plan: FakeAgent.run() is public (not protected) to
satisfy AbstractAgent's public abstract signature in @ag-ui/client@0.0.53.
Spec calls agent.run() directly rather than via (agent as any).run().
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Demo runs end-to-end with no backend or network. Real-backend wiring
is one line away via provideAgUiAgent({ url: ... }).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ag-ui/client@0.0.52 pins rxjs@7.8.1 exactly, which caused npm to install rxjs in two locations (top-level 7.8.2 and nested 7.8.1 under node_modules/@ag-ui/client/). TypeScript saw the two Observable types as incompatible across module boundaries when the AG-UI adapter tried to subscribe to source.agent(). The npm override forces all rxjs resolutions to follow the project's ~7.8.0 range, deduping to a single hoisted install. ABI-compatible. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ride Previous commit (43ad74f) regenerated package-lock.json on macOS, which silently dropped optional platform-specific @next/swc-* bindings for non-darwin platforms. CI on Linux failed with 'Failed to load native binding' on apps/cockpit/next.config.ts and apps/website/. Restore main's lockfile then surgically remove only the nested @ag-ui/client/node_modules/rxjs entry (the override target). Verified: all 24 @next/swc-* entries present, single hoisted rxjs, npm ci passes on clean checkout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation
The AG-UI dojo at `dojo.ag-ui.com` speaks CopilotKit's runtime protocol, not raw AG-UI HTTP — so an HttpAgent can't directly point at it. Until a public AG-UI-native endpoint exists (or we ship a local backend), the in-process fake unblocks the demo and proves the chat-runtime decoupling end-to-end with no external dependencies.
Real-backend swap
One line in `app.config.ts`:
```ts
providers: [provideAgUiAgent({ url: 'https://your.agent.endpoint' })]
```
Test Plan
Plan
🤖 Generated with Claude Code